package com.bootdo.analyze.util;

import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号,开发时使用沙箱提供的APPID，生产环境改成自己的APPID
    public static String APP_ID = "2016101800713946";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String APP_PRIVATE_KEY = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCjwHy/D1F+YyHdTHSfA2nHNCGE0ft57Jud17k07yffmcFuljG+gmDOjsuBbVYhJOBBK4R+v7ZptbDLN4k8Pq8APBbJImlJxcUJor0V6KzqWsWNNRh71/m/FDVTMEGWUS+moYYGwgf1tw1PL5cFYFFkmaHqI6OXWQabOGJ1OWfmjeQQUO6YYAn/on4QFyBdbb7yaF4fexFN0Gh7OgvW7NFON/2jewv+/eJh3Kqn4/YOj1Q5eIPV9ExsPLmWnlfuS/wJNH8RCiEs7d97QZsC5z+YfiAvtyIb3U8rRg37UK7NvpKQ0pdhWrVPfnMG9UENy/h1Y92KfSLsGwGH5nYUXu4nAgMBAAECggEAOGs1j86DUXxuSoTxGWhfpZa8hbqjXlq7MyMEWMydfFjJYIS3FuBs4j4ot6soJbtC2LFZsSH0g29qPlogGnWubfJGF36XsCdHwA4l/8pu6T/lGMXWbbT4A3G+/a5+qn/GXy7/soxfmbU8DLBk5CFPac3VD4q/7oFp2UkQAzuIJNLpPj8wIyyPN8qTAgZdlFQfXrr00s/oOP7YxYtSAVp6mKofhlMMErPBwTb/Oc+LI4d7qVTKE7swHdPhjRuF223r5sMxn9hq5/QUhu72E0FdDHiQwy2uqLz7eqeuoZRxXsKHYUJVHrgkrtQru0Eg46NaT8G/8kQ12TXq9gCTl7dKYQKBgQDTBrC4D2JzIOWE2mIRiko0l0WCt6GoqzgvqtGKroLFyqkrgnCs85Xn04DxKNU2IPQvc93Ph/vd+d4jTi1xBPHSgX6tEjaIfSjU4OIqCBdxFXNzlkxT3oDOnojVctmHfb05DG8b2o1GbSEMD0Q23ZXJTK8D/TwHUN19neFUbgRpkwKBgQDGppOrX/yE6FT/9csxcQccCGRBseW1oQSWjD8PUnK1FjYRqL5WdB711CSqNEoltCnS0MFZX0edMOJhfAl4fxmXc1AkOcIbBJXfQn2WaeFDT/WeLlGGYMidH9F6RqxcYYLvcjqvnyQaf/Iqhc7sebiWnLXxCvZetUYVn8mdRS51nQKBgQC/tNc8DvXgIyV/QKlQx/HLvxTtwIbC5PEBFMyRkSHKL+bpWPGlnRA078a2zuKK7vsGVNtP2nhsWr98EVxkzRomo2+CKQaTjihW5AlyJ7GsENG2Uvb6Rit8CTfDuTd2yDrrpakWg8BOF3urKf9NXJXjrp9cH2S2PLdKk/ANNHkbswKBgQC7Z7zaKTSuIgzGaJin7Qya+qOygmTGI8CTUn3PM6X5hpm9sSbXorbujZOFas0kosHuG3i8mrGR7uMyunSo06dOBMBvXHntSTcmp7CZLQwRl6aM8v+AOWApMzJJG9FRWcDPqkEJG6ZQxbGtQg0DdJWaqP7QBtqEYJlcnyDyGKkK1QKBgFIusy0xdUzawQet75bDi8DoAbmQnA48ovXZ8TwuEHz8m2am+MtV37uXKOYNc+ff2sVSyxfx4/7b3xAFeA/HlSx84X85BpAmUfwO4mmnL9M5zHbtFOby8uE/YDgZqpm/Zk3sCkF6GdYwCHIeG4vVZU0MLA/xQsdkdDgvMqOMMDJ8";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String ALIPAY_PUBLIC_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAiogunPsE7vQ0kRcHAqQ24WfBCqlWdiXunOj/yWEf3VyLfhzDeYNVdUKDOdUNNMMVjs1jSZvW2TI/Z51xwSzs2nkKDgs1UZQFHZKi6FzdxCByCOPSrwsXUvZnxi1kfY7kRAn+IV+g5xBOpXOB14iwOZlVYHw8Tkf+l4CZuVYDoXnAmH5qJD/C6iTk4T9Qq15Pd3UvvRvv/mQrXk08HLdYhyuY+3UZkMSEVU9hmFXgxXIX6+ht54gmRm6/Ssqy9rEWmR77rtnpbrVuu5aRPdSqqUmlx8+bk8+4qud+lEtyG5wh9B6OtFsj8ggF6UFJmhzJ0qdv/7zjEYDxRTDk98kSUwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://localhost:8080/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问(其实就是支付成功后返回的页面)
    public static String return_url = "http://localhost:8080/alipay.trade.page.pay-JAVA-UTF-8/return_url.jsp";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String CHARSET = "utf-8";

    // 支付宝网关，这是沙箱的网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

